package com.tj.jinzao.presenter;

import com.tj.jinzao.api.SubscriberCallBack;
import com.tj.jinzao.base.BasePresenter;
import com.tj.jinzao.callback.IListGroupView;
import com.tj.jinzao.model.ResultResponse;
import com.tj.jinzao.model.User;

public class PersonPresenter extends BasePresenter<IListGroupView<User>> {
    public PersonPresenter(IListGroupView<User> view) {
        super(view);
    }
    //个人资料
    public void getPersonData(String id) {
        addSubscription(mApiService.getUserInfoYunXin(id), new SubscriberCallBack<User>(mView.getContext()) {
            @Override
            protected void onSuccess(User list) {
                if (mView != null) mView.onCreateGroupSuccess(list);
            }

            @Override
            protected void onFailure(ResultResponse response) {
                if (mView != null) mView.onFailed(response);
            }

            @Override
            protected boolean isShowProgress() {
                return false;
            }

            @Override
            protected void onPageSuccess(int currentPage, int allPage, int allSize) {
                if (mView != null) mView.onFailed(null);
            }
        });
    }

}
